package com.example.edwincompose.core.extension

import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.Role

/**
 * 无波纹效果的点击修饰符（带额外参数）
 * @param enabled 是否启用点击
 * @param onClick 点击回调函数
 */
@Composable
fun Modifier.noRippleClickable(
    enabled: Boolean = true,
    onClickLabel:String? = null,
    role: Role? = null,
    onClick: () -> Unit
): Modifier {
    return this.clickable(
        interactionSource = remember { MutableInteractionSource() },
        indication = null,
        enabled = enabled,
        onClickLabel = onClickLabel,
        role= role,
        onClick = onClick
    )
}